<template>
  <div class="hmTip">
    <!--
1:完成组件内容
2：全局注册
3：使用 -->
    <div class="left">
      <div v-if="$slots.left" class="tip">
        <i class="el-icon-info" />
        <slot>
          <span>文本内容</span>
        </slot>
      </div>
    </div>
    <div class="right">
      <slot name="right" />
    </div>
  </div>
</template>
<script>
export default {
  name: 'HmTip',
  mounted() {
    //   this.$slots拿到所有的插槽内容  this.$slots.插槽名，默认插槽的名字叫default
    console.log('$slots', this.$slots)
  }
}
</script>
<style lang="scss" scoped>
.hmTip {
  display: flex;
  padding: 15px;
  align-items: center;
  .left {
    flex: 1;
    display: flex;
    .tip {
      border: 1px solid #91d5ff;
      background-color: #e6f7ff;
      padding: 8px;
      .el-icon-info {
        color: #409eff;
      }
    }
  }
}
</style>
